{include file='public/head'}
<style>
    .tcenter{
        text-align: center;
    }
</style>
<body>
<div class="x-body">
    <form class="layui-form" id='mainForm' method="post" action="storeUser">
        <input type="hidden" id="company_id" name="company_id" value="{$Think.get.company_id}">
        <table class="layui-table">
            <thead>
            <tr>
                <td class="tcenter" style="width: 50px">属性名</td>
                <td class="tcenter">属性详情</td>
            </tr>
            </thead>
            <tbody>
            {if checkArr($shuxing)}
            {volist name="shuxing" id="vo"}
            <tr>
                <td class="tcenter">{$vo.name}</td>
                <td>
                    {if isset($vo['info'])&&count($vo['info'])>0 }
                    {volist name="vo['info']" id="v"}
                    <input type="radio" name="{$vo.name}" value="{$v.id}" title="{$v.name}" lay-skin="primary"
                           id="{$v.id}" class="everysx" _info="{$v.name}" {if in_array($v['id'], $ids)} checked {/if}>
                    {/volist}
                    {/if}
                </td>
            </tr>
            {/volist}
            {/if}
            </tbody>
        </table>

        <input type="hidden" id="paramcon" value="{$Think.get.paramcon}">
        <input type="hidden" id="paramids" value="{$Think.get.paramids}">
        <input style="display: none" onclick="getAllcheck();" value="确认" type="button"/>
    </form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">
    var form = layui.form;
    $(document).ready(function () {
        form.render();
    });

    function getAllcheck() {
        var paramcon = "";
        var paramids = "";
        var fid = $("#fid").val();
        $(".everysx").each(function () {
            if ($(this).prop("checked")) {
                paramids += $(this).attr("id") + ",";
                paramcon += $(this).attr("_info") + ",";
            }
        });
        paramids = paramids.substring(0, paramids.length - 1);
        paramcon = paramcon.substring(0, paramcon.length - 1);
        var ids = $("#paramids").val();
        var con = $("#paramcon").val();
        $("#" + ids, parent.document).val(paramids);
        $("#" + con, parent.document).val(paramcon);

        x_admin_close();//再执行关闭
    }

</script>
</html>
